# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=gammastep
pkgver=2.0.9
pkgrel=2
pkgdesc="Adjust the color temperature of your screen according to your surroundings."
arch=(loong64 x86_64)
url="https://gitlab.com/chinstrap/gammastep"
license=(GPL3)
depends=(geoclue glibc hicolor-icon-theme libdrm libx11 libxcb
libxxf86vm wayland)
makedepends=(glib2 intltool python systemd)
optdepends=(
  'python-gobject: for gammastep-indicator'
  'python-xdg: for gammastep-indicator'
  'gtk3: for gammastep-indicator'
)
source=(https://gitlab.com/chinstrap/$pkgname/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha512sums=('6bd5e2ee21424af87eafff394c7dbe1db19052fbdac2cadd6fbc2af99839f35743125352655dc7b3beccdaec038b480f66125649b61252826c6cbd663444cda0')
b2sums=('91e718b21bf73568e121c9245d7b834634928cf2993b65df126ac93e2c53f61650b340eed193daa3f48133131dc4235547f9ee2be9669ac9a6ddf9417fdbf490')

prepare() {
  cd $pkgname-v$pkgver
  ./bootstrap
}

build() {
  cd $pkgname-v$pkgver
  ./configure --prefix=/usr
  make
}

check() {
  make -k check -C $pkgname-v$pkgver
}

package() {
  depends+=(libgio-2.0.so libgobject-2.0.so libglib-2.0.so)

  make DESTDIR="$pkgdir/" install -C $pkgname-v$pkgver
  install -vDm 644 $pkgname-v$pkgver/{CONTRIBUTING,NEWS,README}.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
